public class Hw_03 {
    /**
     * 利用方法重载，编写四个重载方法，分别求两个整数和、三个整数和、两个小数和、两个字符串类型拼接。
     */
    public int sum(int a, int b) {
        return a + b;
    }

    public int sum(int a, int b, int c) {
        return a + b + c;
    }

    public double sum(double a, double b) {
        return a + b;
    }

    public String sum(String a, String b) {
        return a + b;
    }

    public static void main(String[] args) {
        Hw_03 obj = new Hw_03();
        System.out.println("两个整数的和是：" + obj.sum(3,4));
        System.out.println("三个整数的和是：" + obj.sum(3,4,5));
        System.out.println("两个小数的和是：" + obj.sum(3.35,3.45));
        System.out.println("两个字符串类型拼接为：" + obj.sum("Java","OOP"));
    }
}
